rvlib-shipkit 2.31.0 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/package.json +1 -1
- package/src/advisors/acts.ts +16 -15
- package/src/advisors/advice.ts +56 -102
- package/src/advisors/advisor-view.ts +98 -73
- package/src/advisors/app-graph.ts +1 -1
- package/src/advisors/app.ts +3 -11
- package/src/advisors/cf-api.ts +1 -1
- package/src/advisors/dir-bucket.ts +4 -3
- package/src/advisors/edge/api.ts +26 -198
- package/src/advisors/edge/bucket.ts +2 -2
- package/src/advisors/edge/handler.ts +13 -155
- package/src/advisors/edge/here.ts +5 -5
- package/src/advisors/edge/pages.ts +12 -9
- package/src/advisors/edge/shell.ts +6 -5
- package/src/advisors/edge/sign-in.ts +101 -36
- package/src/advisors/edge/status.ts +19 -6
- package/src/advisors/edge/types.ts +36 -60
- package/src/advisors/expose.ts +29 -29
- package/src/advisors/here.ts +12 -12
- package/src/advisors/invite-send.ts +79 -35
- package/src/advisors/invite.ts +31 -8
- package/src/advisors/job.ts +24 -16
- package/src/advisors/login.ts +40 -15
- package/src/advisors/owner-store.ts +46 -22
- package/src/advisors/photos.ts +3 -3
- package/src/advisors/project.ts +25 -23
- package/src/advisors/reach.ts +89 -0
- package/src/advisors/rights.ts +1 -1
- package/src/advisors/routes.ts +55 -74
- package/src/advisors/scan.ts +0 -4
- package/src/advisors/setup-run.ts +14 -14
- package/src/advisors/share-trace.ts +3 -3
- package/src/advisors/{door-probe.ts → sign-in-probe.ts} +7 -6
- package/src/advisors/speaks.ts +29 -0
- package/src/advisors/sync.ts +92 -182
- package/src/advisors/tunnel.ts +6 -5
- package/src/advisors/users-listen.ts +92 -0
- package/src/advisors/users-router.ts +257 -85
- package/src/advisors/users-store.ts +81 -0
- package/src/agent-time/blocked-scan.ts +181 -0
- package/src/agent-time/registry.ts +12 -5
- package/src/agent-time/store.ts +9 -109
- package/src/asks/ask-bar-fold.ts +2 -1
- package/src/asks/ask-close.ts +2 -1
- package/src/asks/ask-doc.ts +2 -1
- package/src/asks/ask-migrate.ts +3 -2
- package/src/asks/ask-steps-fold.ts +2 -1
- package/src/asks/ask-store.ts +4 -3
- package/src/check.ts +3 -43
- package/src/checks/SK001-package-json-shape.check.ts +4 -55
- package/src/checks/SK004-gitignore-policy.check.ts +24 -69
- package/src/checks/SK013-one-way-in-policy.check.ts +3 -7
- package/src/checks/SK017-vscode-hub-task.check.ts +4 -4
- package/src/checks/SK019-tests-run-in-units.check.ts +3 -14
- package/src/checks/SK020-self-spawning-check.check.ts +5 -7
- package/src/checks/SK035-public-clean.check.ts +1 -1
- package/src/checks/SK039-vscode-watch-generated.check.ts +1 -1
- package/src/checks/SK042-post-kinds.check.ts +5 -14
- package/src/checks/SK054-agent-allow-list.check.ts +5 -74
- package/src/checks/SK055-retired-config-keys.check.ts +45 -0
- package/src/cli/cmd_Advisors.ts +11 -45
- package/src/cli/cmd_Asks.ts +3 -10
- package/src/cli/cmd_Backup.ts +25 -127
- package/src/cli/cmd_BackupTargets.ts +1 -1
- package/src/cli/cmd_Checks.ts +0 -14
- package/src/cli/cmd_Db.ts +3 -82
- package/src/cli/cmd_Home.ts +4 -32
- package/src/cli/cmd_Hq.ts +0 -17
- package/src/cli/cmd_Releases.ts +57 -4
- package/src/cli/cmd_Review.ts +333 -354
- package/src/cli/cmd_SocialDrafts.ts +6 -13
- package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_Trailer.ts +1 -1
- package/src/cli/inbox-hook-run.ts +5 -23
- package/src/cli/registry-heads.ts +5 -55
- package/src/cli/registry.ts +1 -5
- package/src/cli/review-here.ts +1 -1
- package/src/cli.ts +2 -2
- package/src/collections/collection-types.ts +1 -1
- package/src/collections/review.ts +5 -4
- package/src/core/agent-allow-policy.ts +32 -2
- package/src/core/agent-env.ts +8 -0
- package/src/core/allow-rows.ts +74 -0
- package/src/core/check-file-names.ts +19 -106
- package/src/core/footprint.ts +17 -13
- package/src/core/identities-root.ts +1 -4
- package/src/core/layout.ts +1 -2
- package/src/core/machine-db.ts +33 -208
- package/src/core/machine-layout.ts +14 -127
- package/src/core/mask-source.ts +60 -0
- package/src/core/memory-watch.ts +17 -14
- package/src/core/motherhome.ts +8 -35
- package/src/core/one-way-in-policy.ts +0 -3
- package/src/core/repo-walk.ts +0 -9
- package/src/core/retention.ts +1 -9
- package/src/core/retired-checks.ts +2 -0
- package/src/core/tmux-policy.ts +1 -1
- package/src/core/tree-watch.ts +2 -2
- package/src/core/when.ts +7 -45
- package/src/gate/discover-checks.ts +42 -32
- package/src/gate/gate-checks.ts +21 -131
- package/src/gate/pre-commit-discovery.ts +16 -25
- package/src/gate/run-check.ts +0 -4
- package/src/gate/run-fix.ts +5 -17
- package/src/gate/run-fixers.ts +6 -42
- package/src/home/app-sign.ts +2 -2
- package/src/home/backup-status.ts +52 -92
- package/src/home/backup-verdict.ts +2 -2
- package/src/home/daemon-jobs.ts +51 -95
- package/src/home/database-words.ts +1 -2
- package/src/home/databases.ts +9 -25
- package/src/home/home-launchd.ts +0 -6
- package/src/home/home-paths.ts +8 -4
- package/src/home/home-routes.ts +3 -10
- package/src/home/home-state.ts +2 -14
- package/src/home/inbox-shape.ts +14 -15
- package/src/home/inbox.ts +1 -1
- package/src/home/machine-repair.ts +102 -103
- package/src/home/resume.ts +1 -15
- package/src/home/run-daemon.ts +4 -11
- package/src/home/space-page.ts +3 -2
- package/src/home/supervise.ts +3 -7
- package/src/hooks/hook-config.ts +6 -7
- package/src/hooks/leak-guard.ts +1 -1
- package/src/hooks/run-hooks.ts +0 -5
- package/src/hq/daemon-db.ts +8 -8
- package/src/hq/door.ts +3 -16
- package/src/hq/hq-db.ts +4 -3
- package/src/hq/hq-local.ts +1 -2
- package/src/hq/hq-store.ts +0 -15
- package/src/hq/item-direct.ts +8 -10
- package/src/hq/item-fill.ts +37 -0
- package/src/hq/kinds/item-gone.ts +7 -10
- package/src/hq/kinds/item-msg.ts +12 -18
- package/src/hq/kinds/item.ts +13 -19
- package/src/hq/kinds/report.ts +3 -4
- package/src/hq/owner-switch.ts +3 -3
- package/src/hq/report.ts +5 -9
- package/src/hq/switch.ts +2 -11
- package/src/hq/thread-sync.ts +5 -17
- package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
- package/src/http/owner-word.ts +1 -1
- package/src/identities/machine.ts +16 -0
- package/src/init-repo.ts +0 -1
- package/src/ledger/check-stats.ts +6 -5
- package/src/ledger/db.ts +2 -4
- package/src/ledger/record-kept.ts +117 -48
- package/src/ledger/run-log.ts +21 -2
- package/src/ledger/slow-tests.ts +96 -0
- package/src/ledger/store.ts +3 -86
- package/src/ledger/suite-log.ts +8 -2
- package/src/media-store/backup/facts.ts +3 -37
- package/src/media-store/backup/keys.ts +1 -8
- package/src/media-store/backup/manifest.ts +6 -67
- package/src/media-store/backup/restore.ts +4 -13
- package/src/media-store/backup/retention.ts +13 -1
- package/src/media-store/backup/run.ts +6 -267
- package/src/media-store/backup/snapshot.ts +2 -38
- package/src/media-store/backup/sources.ts +3 -113
- package/src/media-store/backup/target-send.ts +5 -29
- package/src/media-store/db.ts +8 -7
- package/src/media-store/forget-one.ts +1 -1
- package/src/media-store/forget.ts +1 -80
- package/src/orchestrator/guards.ts +0 -1
- package/src/orchestrator/presence.ts +2 -2
- package/src/orchestrator/routes.ts +1 -1
- package/src/orchestrator/started.ts +0 -9
- package/src/orchestrator/talk-key.ts +3 -4
- package/src/orchestrator/unheard.ts +1 -1
- package/src/recordings/edit.ts +3 -3
- package/src/recordings/marks-draw.ts +17 -6
- package/src/recordings/marks.ts +120 -9
- package/src/reflections/reflections-queue.ts +3 -10
- package/src/release/notes.ts +1 -1
- package/src/release/public-clean.ts +66 -6
- package/src/release/run-bump.ts +11 -0
- package/src/release/run-release.ts +4 -0
- package/src/releases/from-thread.ts +3 -3
- package/src/releases/model.ts +186 -36
- package/src/releases/store.ts +13 -3
- package/src/releases/validate.ts +83 -0
- package/src/repo-config.ts +29 -64
- package/src/review/answer-kinds.ts +61 -4
- package/src/review/blocked-guard.ts +11 -0
- package/src/review/blocked-object.ts +298 -0
- package/src/review/cells.ts +116 -229
- package/src/review/close.ts +39 -1
- package/src/review/doc-save.ts +3 -2
- package/src/review/draft-item.ts +1 -1
- package/src/review/events.ts +3 -7
- package/src/review/expect.ts +23 -39
- package/src/review/format.ts +79 -46
- package/src/review/glyphs.ts +1 -0
- package/src/review/hand-over.ts +3 -3
- package/src/review/heard.ts +1 -1
- package/src/review/holds-sync.ts +2 -1
- package/src/review/inbox-hook.ts +2 -2
- package/src/review/inbox-read.ts +39 -33
- package/src/review/instruction-guards.ts +12 -0
- package/src/review/instructions.ts +0 -1
- package/src/review/item-db.ts +13 -43
- package/src/review/item-hq.ts +2 -2
- package/src/review/item-rows.ts +3 -14
- package/src/review/kind-catalog.ts +3 -1
- package/src/review/kinds.ts +18 -8
- package/src/review/live-view.ts +3 -0
- package/src/review/media-kind.ts +1 -1
- package/src/review/mentions.ts +1 -2
- package/src/review/model.ts +158 -114
- package/src/review/move.ts +149 -0
- package/src/review/need-threads.ts +3 -2
- package/src/review/object-card.ts +11 -0
- package/src/review/object-read.ts +6 -1
- package/src/review/one-block.ts +1 -1
- package/src/review/owner-read.ts +1 -1
- package/src/review/phone-push.ts +10 -9
- package/src/review/previews.ts +32 -4
- package/src/review/push.ts +2 -2
- package/src/review/recap.ts +129 -0
- package/src/review/referring.ts +6 -3
- package/src/review/reflection-object.ts +4 -3
- package/src/review/routes.ts +49 -19
- package/src/review/secret-route.ts +3 -2
- package/src/review/settle.ts +0 -6
- package/src/review/snooze.ts +5 -3
- package/src/review/speaker.ts +68 -0
- package/src/review/start-title.ts +19 -0
- package/src/review/store.ts +86 -59
- package/src/review/{wakes.ts → thread-events.ts} +92 -7
- package/src/review/thread-md.ts +35 -14
- package/src/review/thread-state.ts +798 -0
- package/src/review/threads.ts +29 -347
- package/src/review/traces.ts +104 -7
- package/src/review/trailer-item.ts +1 -1
- package/src/review/unit.ts +7 -9
- package/src/review/verdict-items.ts +12 -10
- package/src/review/view-layout.ts +25 -1
- package/src/review/watch-feed.ts +1 -2
- package/src/review/working-guards.ts +2 -3
- package/src/rules/untrack-generated.ts +1 -15
- package/src/secrets/lapse.ts +2 -1
- package/src/serve/hub-app/advisor-app.tsx +4 -4
- package/src/serve/hub-app/advisor-face.tsx +9 -3
- package/src/serve/hub-app/advisor-host.ts +27 -27
- package/src/serve/hub-app/advisors-model.ts +17 -8
- package/src/serve/hub-app/advisors-rights.tsx +1 -1
- package/src/serve/hub-app/advisors-st.ts +15 -14
- package/src/serve/hub-app/advisors-view.tsx +13 -11
- package/src/serve/hub-app/app-bridge.ts +23 -3
- package/src/serve/hub-app/asks-page.tsx +1 -1
- package/src/serve/hub-app/auto-text.tsx +71 -16
- package/src/serve/hub-app/check-view.tsx +0 -8
- package/src/serve/hub-app/controls.css +14 -3
- package/src/serve/hub-app/database-view.tsx +1 -2
- package/src/serve/hub-app/git-view.tsx +3 -1
- package/src/serve/hub-app/hub.css +12 -5
- package/src/serve/hub-app/icons.tsx +1 -1
- package/src/serve/hub-app/inbox-view.tsx +1 -2
- package/src/serve/hub-app/live-sources.ts +2 -2
- package/src/serve/hub-app/main-panel.tsx +2 -1
- package/src/serve/hub-app/panel-repo.ts +0 -9
- package/src/serve/hub-app/pic.tsx +29 -12
- package/src/serve/hub-app/polled.ts +16 -2
- package/src/serve/hub-app/recordings-st.ts +23 -2
- package/src/serve/hub-app/recordings-view.tsx +68 -10
- package/src/serve/hub-app/ref-pill.ts +1 -1
- package/src/serve/hub-app/repo-st.ts +1 -2
- package/src/serve/hub-app/review/advisor-add.tsx +1 -1
- package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
- package/src/serve/hub-app/review/draft-body.tsx +2 -2
- package/src/serve/hub-app/review/heard-line.tsx +1 -1
- package/src/serve/hub-app/review/instructions-view.tsx +1 -8
- package/src/serve/hub-app/review/kind-states.tsx +14 -9
- package/src/serve/hub-app/review/kit.tsx +4 -11
- package/src/serve/hub-app/review/lane-bar.tsx +3 -3
- package/src/serve/hub-app/review/lightbox.tsx +15 -11
- package/src/serve/hub-app/review/line-window.ts +4 -1
- package/src/serve/hub-app/review/live-bar-st.ts +2 -2
- package/src/serve/hub-app/review/live-view.tsx +57 -1
- package/src/serve/hub-app/review/object-panel.tsx +20 -8
- package/src/serve/hub-app/review/question-views.tsx +181 -54
- package/src/serve/hub-app/review/recap-bar.tsx +40 -0
- package/src/serve/hub-app/review/request-cell.tsx +48 -0
- package/src/serve/hub-app/review/review-cells.tsx +154 -96
- package/src/serve/hub-app/review/review-host.ts +2 -2
- package/src/serve/hub-app/review/review-kit.ts +17 -11
- package/src/serve/hub-app/review/review-list.tsx +23 -31
- package/src/serve/hub-app/review/review-st.ts +30 -40
- package/src/serve/hub-app/review/review-thread.tsx +139 -85
- package/src/serve/hub-app/review/review-views.tsx +124 -68
- package/src/serve/hub-app/review/share-lines.tsx +4 -4
- package/src/serve/hub-app/review/start-st.ts +2 -5
- package/src/serve/hub-app/review/superseded-runs.ts +4 -3
- package/src/serve/hub-app/review/thread-close.tsx +10 -7
- package/src/serve/hub-app/review/thread-st.ts +372 -201
- package/src/serve/hub-app/review/tone-bar.tsx +126 -0
- package/src/serve/hub-app/review/tones.ts +35 -0
- package/src/serve/hub-app/review/trailer-body.tsx +2 -2
- package/src/serve/hub-app/review/trailer-st.ts +3 -2
- package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
- package/src/serve/hub-app/review.css +180 -106
- package/src/serve/hub-app/search-view.tsx +1 -1
- package/src/serve/hub-app/social/social-model.ts +0 -4
- package/src/serve/hub-app/source-acts.ts +2 -1
- package/src/serve/hub-app/stores/stores-page.tsx +2 -2
- package/src/serve/hub-app/terminal-sources.tsx +2 -1
- package/src/serve/hub-app/thread-row.tsx +3 -4
- package/src/serve/hub-app/tree-build.ts +0 -4
- package/src/serve/hub-app/urls-view.tsx +2 -1
- package/src/serve/hub-app/view-layout.css +13 -3
- package/src/serve/hub-app/wikis-view.tsx +5 -2
- package/src/serve/hub-runtime.ts +7 -37
- package/src/serve/project-gutter-route.ts +6 -2
- package/src/serve/read-thread.ts +20 -2
- package/src/serve/read-worker.ts +9 -1
- package/src/serve/record-pages.ts +46 -0
- package/src/serve/serve-hub.ts +2 -2
- package/src/serve/terminal-host.ts +1 -1
- package/src/serve/terminal-route.ts +1 -3
- package/src/serve/tracked-watch.ts +1 -3
- package/src/setup-house.ts +2 -2
- package/src/shipkit-files.ts +1 -1
- package/src/shipkit.ts +1 -6
- package/src/shot/film-box.ts +0 -20
- package/src/social/drafts.ts +1 -1
- package/src/social/kinds.ts +6 -29
- package/src/social/load.ts +2 -2
- package/src/social/post-object.ts +3 -2
- package/src/social/release-stage.ts +1 -1
- package/src/social/stage.ts +2 -2
- package/src/stores/model.ts +4 -0
- package/src/stores/routes.ts +11 -3
- package/src/suite/judge-suites.ts +58 -0
- package/src/suite/red-alone.ts +54 -18
- package/src/suite/runner-shapes.ts +2 -2
- package/src/suite/suite-cli.ts +67 -14
- package/src/suite/test-units.ts +2 -1
- package/src/urls/fill.ts +1 -1
- package/src/urls/places.ts +1 -2
- package/src/vault/vault-config.ts +2 -2
- package/src/vault/vault-init.ts +1 -5
- package/src/wiki/graph-page.ts +14 -2
- package/src/advisors/copy-truth.ts +0 -49
- package/src/advisors/door-child.ts +0 -112
- package/src/advisors/door-serve.ts +0 -52
- package/src/advisors/door.ts +0 -118
- package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
- package/src/checks/SK029-explicit-check-files.check.ts +0 -112
- package/src/checks/SK048-one-local-file.check.ts +0 -36
- package/src/core/config-rewrite.ts +0 -111
- package/src/core/daemon-port.ts +0 -10
- package/src/core/legacy-shapes.ts +0 -263
- package/src/core/migrate-layout.ts +0 -638
- package/src/core/port-check-cli.ts +0 -52
- package/src/core/port-check-file.ts +0 -295
- package/src/core/port-check-files.ts +0 -31
- package/src/gate/discover-legacy-checks.ts +0 -26
- package/src/home/home-move.ts +0 -527
- package/src/home/machine-fold.ts +0 -810
- package/src/hq/item-shapes.ts +0 -54
- package/src/hq/kinds/items-read.ts +0 -4
- package/src/media-store/backup/daemon.ts +0 -220
- package/src/media-store/backup/kept.ts +0 -241
- package/src/media-store/backup/prune.ts +0 -359
- package/src/media-store/backup/secret.ts +0 -88
- package/src/media-store/backup/ssh-space.ts +0 -202
- package/src/media-store/backup/watch.ts +0 -117
- package/src/review/band.ts +0 -182
- package/src/review/folders.ts +0 -216
- package/src/review/hook-ask.ts +0 -58
- package/src/review/role.ts +0 -48
- package/src/review/thread-fold.ts +0 -64
- package/src/review/wait.ts +0 -91
- package/src/rules/rule.ts +0 -43
- package/src/serve/hook-thread.ts +0 -37
- package/src/serve/hook-work.ts +0 -92
- package/src/serve/hook-worker.ts +0 -57
- package/src/serve/hub-app/review/dock.tsx +0 -147
- package/src/serve/hub-app/review/faces.tsx +0 -18
- package/src/serve/hub-app/review/item-verdict.tsx +0 -112
- package/src/serve/hub-app/review/review-board.tsx +0 -48
- /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
## 2.32.0
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- **One thread state model** (`review/thread-state.ts`): whose turn, closed, owed and the holder read from one place, held by a verb by state table and a guard against any second computation.
|
|
6
|
+
- **Five tones in one answer bar** at the foot of a version or a question: ok, ok with a fix, rework, wrong direction, your call. A sixth quiet action, « no answer », takes the request off the owner's turn and wakes no agent.
|
|
7
|
+
- **Thread recaps**: `sk thread recap <address> --body <file>` (four checked sections) and `--offer`; once the owner accepts one, `show`, the inbox and the hub read from it, the history one click away.
|
|
8
|
+
- **Blocked commands as cards**: a command the auto mode classifier refused becomes a `blocked:` thread the owner allows in one click.
|
|
9
|
+
- **Threads move**: « move to project… » in a thread's head, `sk thread suggest-move`, and an old link opens the moved thread.
|
|
10
|
+
- **Picks**: `sk thread ask --row` asks one pick per thing, « none of these » ends every choice, option pictures draw small, and the lightbox compares a question's pictures with a side panel to pick from.
|
|
11
|
+
- **Advisors**: one users' port, a password reset by mail, a failed sign in in a red box.
|
|
12
|
+
- **`sk releases check`** names every problem of next.md in one run; `sk bump` reads it first.
|
|
13
|
+
- **Recordings**: arrows bend through points.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **A test slow under load never blocks the gate or a release**: a timeout or a suite cut by the phase ceiling runs again alone; passing alone, it is one « slow under load » line and a row in `.shipkit/cache/slow-tests.json`.
|
|
18
|
+
- **A reply answers nothing an agent asked**: a question, a proposed change or a verdict request is answered in its own control only.
|
|
19
|
+
- **Any close moots what was asked before it**, whoever closed the thread.
|
|
20
|
+
- **Bookkeeping traces step back** and quiet runs fold into one line.
|
|
21
|
+
- **Hub speed in WebKit**: a thread heavy with pictures scrolls at 60 fps, pictures and avatars load at their size.
|
|
22
|
+
|
|
23
|
+
### Removed
|
|
24
|
+
|
|
25
|
+
- `sk review`, `sk thread add`, `sk thread pick`, `post --choice`, `sk thread import|export|migrate`, `sk units`, `sk hq cards|door`, `sk advisors live`, the dispatcher role, the old `page:review` and `topic:` addresses, the root layout move, the store fold and the backup writer, with the one time readers of old files and names.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- **A question's pictures on a thread the owner opened** draw in its options, never as his note's own image.
|
|
30
|
+
- **Advisors**: a password manager that fills the code field no longer blocks a set password; a thread brought back is a trace, never words in the owner's name.
|
|
31
|
+
|
|
1
32
|
## 2.31.0
|
|
2
33
|
|
|
3
34
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rvlib-shipkit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.0",
|
|
4
4
|
"funding": "https://github.com/sponsors/rvion",
|
|
5
5
|
"description": "All-in-one repo companion: ci gate (task DAG), auto-discovered health checks, release-contract fulfillness, asks queue, md-wiki tools, asset atelier, live tui",
|
|
6
6
|
"license": "MIT",
|
package/src/advisors/acts.ts
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
// A profile grants nothing, so an agent may prepare one; an agent's share waits for his confirm; every other act that
|
|
4
4
|
// widens what leaves is his alone. A guard against a mistake, not a wall: a process of his user can write the file too
|
|
5
5
|
import { randomBytes } from 'node:crypto'
|
|
6
|
-
import { AGENT_ENV } from '../
|
|
7
|
-
import {
|
|
6
|
+
import { AGENT_ENV } from '../core/agent-env.ts'
|
|
7
|
+
import { readAll, storeDir } from '../review/store.ts'
|
|
8
8
|
import { snoozeThread } from '../review/snooze.ts'
|
|
9
|
-
import {
|
|
9
|
+
import { threadOfAddress, threadsOf, type Thread } from '../review/threads.ts'
|
|
10
10
|
import { addressOrThrow, ownAddressOf } from '../review/model.ts'
|
|
11
11
|
import { accessOf, advisorOf, isLive, profileOf, readState, withState, type Access, type Advisor, type OwnerState, type Share } from './owner-store.ts'
|
|
12
12
|
import { DAYS_MAX, rightsOf, withLayer, type RightsScope } from './rights.ts'
|
|
13
13
|
import { dropPhotoFiles } from './photos.ts'
|
|
14
|
+
import { asideRefusal, threadState } from '../review/thread-state.ts'
|
|
14
15
|
|
|
15
16
|
/** who acts: the owner (the hub, his terminal), or an agent by its name */
|
|
16
17
|
export type Actor = 'owner' | { agent: string }
|
|
@@ -159,17 +160,17 @@ const threadIn = (root: string, address: string): Thread | null => threadOfAddre
|
|
|
159
160
|
function setAside(root: string, address: string, until: Date, now: Date): boolean {
|
|
160
161
|
const t = threadIn(root, address)
|
|
161
162
|
if (t === null) return false
|
|
162
|
-
|
|
163
|
-
if (turn !== 'yours' && turn !== 'aside') return false
|
|
163
|
+
if (asideRefusal(threadState(t, now)) !== null) return false
|
|
164
164
|
snoozeThread(storeDir(root), t.head.item.id, { until, who: 'owner', now })
|
|
165
165
|
return true
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
/** a thread still set aside comes back to his turn
|
|
169
|
-
|
|
168
|
+
/** a thread still set aside comes back to his turn: a trace line, its cause the trace beside it (the share that ended,
|
|
169
|
+
* the advice that waits), never words in his name */
|
|
170
|
+
export function bringBack(root: string, address: string, now = new Date()): boolean {
|
|
170
171
|
const t = threadIn(root, address)
|
|
171
|
-
if (t === null ||
|
|
172
|
-
|
|
172
|
+
if (t === null || (threadState(t, now).aside?.until ?? null) === null) return false
|
|
173
|
+
snoozeThread(storeDir(root), t.head.item.id, { until: null, who: 'owner', now })
|
|
173
174
|
return true
|
|
174
175
|
}
|
|
175
176
|
|
|
@@ -225,8 +226,8 @@ export function share(dir: string, o: { advisor: string; repo: string; root: str
|
|
|
225
226
|
}
|
|
226
227
|
|
|
227
228
|
/** his « add advisor » in a thread's head: a new person made first (`add`, or the one that email names), then the
|
|
228
|
-
* share
|
|
229
|
-
export function shareFromHead(dir: string, o: { advisor?: string; add?: { name: string; email: string }; repo: string; root: string; address: string;
|
|
229
|
+
* share */
|
|
230
|
+
export function shareFromHead(dir: string, o: { advisor?: string; add?: { name: string; email: string }; repo: string; root: string; address: string; defer?: boolean }, actor: Actor, now = new Date()): Share {
|
|
230
231
|
ownerOnly(actor, 'sharing from a thread head')
|
|
231
232
|
const email = o.add?.email.trim().toLowerCase()
|
|
232
233
|
const known = email === undefined ? undefined : readState(dir).advisors.find((a) => a.email === email)
|
|
@@ -269,7 +270,7 @@ function revokeWhere(dir: string, pick: (x: Share, s: OwnerState) => boolean, no
|
|
|
269
270
|
}
|
|
270
271
|
|
|
271
272
|
const backAll = (ended: { share: Share; name: string }[], now: Date): void => {
|
|
272
|
-
for (const { share: x
|
|
273
|
+
for (const { share: x } of ended) if (x.deferred) bringBack(x.root, x.address, now)
|
|
273
274
|
}
|
|
274
275
|
|
|
275
276
|
/** unsharing narrows what leaves: anyone may, an agent too */
|
|
@@ -305,7 +306,7 @@ export function renew(dir: string, id: string, actor: Actor, now = new Date(), d
|
|
|
305
306
|
})
|
|
306
307
|
if (x.deferred) {
|
|
307
308
|
const t = threadIn(x.root, x.address)
|
|
308
|
-
if (t !== null &&
|
|
309
|
+
if (t !== null && (threadState(t, now).aside?.until ?? null) !== null) snoozeThread(storeDir(x.root), t.head.item.id, { until: new Date(x.expires), who: 'owner', now })
|
|
309
310
|
}
|
|
310
311
|
return x
|
|
311
312
|
}
|
|
@@ -324,7 +325,7 @@ export function include(dir: string, o: { share: string; key: string; how: 'reda
|
|
|
324
325
|
}
|
|
325
326
|
|
|
326
327
|
/** a project's access that shows every thread (`see: all`): a live share made for each thread it does not share yet,
|
|
327
|
-
* ending with the access.
|
|
328
|
+
* ending with the access. The owner's pass runs it first; its shares come from the owner's act, never an agent's.
|
|
328
329
|
* `between`: a test's stand in for another process's write between the read and the lock */
|
|
329
330
|
export function shareAllOfAccess(dir: string, now = new Date(), between?: () => void): number {
|
|
330
331
|
// the thread stores are read outside the lock; every want is checked again inside it, so an access ended or a
|
|
@@ -362,7 +363,7 @@ export function shareAllOfAccess(dir: string, now = new Date(), between?: () =>
|
|
|
362
363
|
/** the person a thread is deferred to now: a live share he deferred, the thread still set aside. Never stored: his
|
|
363
364
|
* reply or an agent's urgent word ends the aside, and the thread is his again */
|
|
364
365
|
export function deferredTo(s: OwnerState, o: { repo: string; address: string; thread: Thread }, now = new Date()): Advisor | null {
|
|
365
|
-
if (
|
|
366
|
+
if ((threadState(o.thread, now).aside?.until ?? null) === null) return null
|
|
366
367
|
const x = s.shares.find((y) => y.repo === o.repo && y.address === o.address && y.deferred && isLive(y, now))
|
|
367
368
|
return x === undefined ? null : (s.advisors.find((a) => a.id === x.advisor) ?? null)
|
|
368
369
|
}
|
package/src/advisors/advice.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
// a person's answer on the Mac (wiki tools/shipkit/advisors.md, The advice):
|
|
2
|
-
// input, kept pending outside the thread, so no agent wakes and no version settles;
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// lands under their name (their words, their answer, their verdict),
|
|
6
|
-
//
|
|
7
|
-
// a
|
|
1
|
+
// a person's answer on the Mac (wiki tools/shipkit/advisors.md, The advice): taken at the request on the users' port as
|
|
2
|
+
// hostile input, kept pending outside the thread, so no agent wakes and no version settles; the owner's confirm
|
|
3
|
+
// performs the owner's own act, the owner's override sets it aside. A thread a person proposes waits the same way, and
|
|
4
|
+
// the files of either wait in the port's folder, quarantined, until the owner decides. What the person's rights make
|
|
5
|
+
// direct (advisors/rights.ts) skips the wait: it lands under their name (their words, their answer, their verdict),
|
|
6
|
+
// never as the owner's act
|
|
7
|
+
// the one constraint a reader breaks first: nothing here writes a thread store before the owner's click (confirm,
|
|
8
|
+
// accept) or a direct right the owner wrote
|
|
8
9
|
import { createHash } from 'node:crypto'
|
|
9
10
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
|
10
11
|
import { verdictOf, type Origin, type ReviewItem, type Verdict } from '../review/model.ts'
|
|
11
12
|
import { join } from 'node:path'
|
|
12
13
|
import { addMessage, answerAsk, appendMessage, raiseItem, readAll, storeDir, writeVerdict } from '../review/store.ts'
|
|
13
14
|
import { gateOf, rightsOf, type ActKind } from './rights.ts'
|
|
14
|
-
import { membersOf, threadOfAddress
|
|
15
|
+
import { membersOf, threadOfAddress } from '../review/threads.ts'
|
|
15
16
|
import type { Bucket } from './edge/bucket.ts'
|
|
16
17
|
import { cleanName, cleanType } from './edge/form.ts'
|
|
17
18
|
import { ADVICE_KINDS, ADVICE_PENDING_MAX, ADVICE_PER_HOUR, ADVICE_TEXT_MAX, ENTRY_RE, FILE_MAX, FILE_NAME_MAX, FILES_MAX, KEYS, PROPOSAL_TITLE_MAX, PROPOSALS_PENDING_MAX, PROPOSALS_PER_HOUR, type AdviceKind } from './edge/types.ts'
|
|
18
19
|
import { bringBack, newId, share, type Actor } from './acts.ts'
|
|
19
20
|
import { talkKey } from '../orchestrator/talk-key.ts'
|
|
21
|
+
import { NO_TITLE, startTitle } from '../review/start-title.ts'
|
|
20
22
|
import { opaqueItem, opaqueMessage, questionHash } from './project.ts'
|
|
21
23
|
import { accessOf, isLive, startPlacesOf, readState, withState, type Advice, type OwnerState, type PendingFile, type Proposal, type Share } from './owner-store.ts'
|
|
24
|
+
import { threadState } from '../review/thread-state.ts'
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/** the files an entry names, each as the door cleaned it; null for anything else */
|
|
26
|
+
/** the files an entry names, each as the users' port cleaned it; null for anything else */
|
|
26
27
|
function filesOfWire(v: unknown): PendingFile[] | undefined | null {
|
|
27
28
|
if (v === undefined) return undefined
|
|
28
29
|
if (!Array.isArray(v) || v.length === 0 || v.length > FILES_MAX) return null
|
|
@@ -39,7 +40,7 @@ function filesOfWire(v: unknown): PendingFile[] | undefined | null {
|
|
|
39
40
|
return out
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
/** an
|
|
43
|
+
/** an advice as sent, read with a strict schema: every field its type, nothing else kept; null for anything else */
|
|
43
44
|
export function adviceOfWire(raw: unknown, expectEmail: string): Omit<Advice, 'id' | 'share' | 'advisor' | 'state'> | null {
|
|
44
45
|
if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return null
|
|
45
46
|
const r = raw as Record<string, unknown>
|
|
@@ -90,28 +91,11 @@ export function proposalOfWire(raw: unknown, expectEmail: string): Pick<Proposal
|
|
|
90
91
|
return { at: r['at'], title: title.trim(), ...(typeof text === 'string' && text.trim() !== '' ? { text: text.trim() } : {}), ...(files !== undefined ? { files } : {}) }
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
/** an inbox object as json, null when absent, too big or not json */
|
|
94
|
-
async function readEntry(bucket: Bucket, key: string): Promise<unknown> {
|
|
95
|
-
const bytes = await bucket.get(key)
|
|
96
|
-
if (bytes === null || bytes.byteLength > INBOX_FILE_MAX) return null
|
|
97
|
-
try {
|
|
98
|
-
return JSON.parse(new TextDecoder().decode(bytes))
|
|
99
|
-
} catch {
|
|
100
|
-
return null
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** the entry of an inbox key, `<ms>-<random>`, null for any other name */
|
|
105
|
-
const entryOf = (key: string): string | null => {
|
|
106
|
-
const e = /\/([^/]+)\.json$/.exec(key)?.[1]
|
|
107
|
-
return e !== undefined && ENTRY_RE.test(e) ? e : null
|
|
108
|
-
}
|
|
109
|
-
|
|
110
94
|
/** an upload no pending submission names leaves the bucket: a decided one at once, an unknown one (its record not
|
|
111
95
|
* written yet) after an hour */
|
|
112
96
|
const UPLOAD_GRACE_MS = 3_600_000
|
|
113
97
|
|
|
114
|
-
async function sweepUploads(dir: string, bucket: Bucket, now: Date): Promise<void> {
|
|
98
|
+
export async function sweepUploads(dir: string, bucket: Bucket, now: Date): Promise<void> {
|
|
115
99
|
const s = readState(dir)
|
|
116
100
|
const pending = new Set<string>()
|
|
117
101
|
const known = new Set<string>()
|
|
@@ -134,7 +118,7 @@ async function sweepUploads(dir: string, bucket: Bucket, now: Date): Promise<voi
|
|
|
134
118
|
}
|
|
135
119
|
}
|
|
136
120
|
|
|
137
|
-
/** the store's ids behind the
|
|
121
|
+
/** the store's ids behind the view's ids of one share: an advice names what the advisor's page read */
|
|
138
122
|
function idsOfShare(x: Share): Map<string, string> {
|
|
139
123
|
const out = new Map<string, string>()
|
|
140
124
|
const thread = threadOfAddress(x.address, readAll(storeDir(x.root)).items)
|
|
@@ -154,68 +138,13 @@ export function adviceInStore<T extends { item?: string; message?: string }>(w:
|
|
|
154
138
|
return { ...w, ...(item !== undefined ? { item } : {}), ...(message !== undefined ? { message } : {}) }
|
|
155
139
|
}
|
|
156
140
|
|
|
157
|
-
/** each
|
|
158
|
-
*
|
|
159
|
-
export async function
|
|
141
|
+
/** each pending advice the person's rights make direct now (a right given since, a try that failed), into the thread;
|
|
142
|
+
* how many landed */
|
|
143
|
+
export async function deliverPending(dir: string, bucket: Bucket, now: Date): Promise<number> {
|
|
160
144
|
const s = readState(dir)
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
for (const x of s.shares) {
|
|
165
|
-
const keys = await bucket.list(KEYS.inbox(x.id))
|
|
166
|
-
const a = s.advisors.find((y) => y.id === x.advisor)
|
|
167
|
-
const ids = keys.length === 0 ? new Map<string, string>() : idsOfShare(x)
|
|
168
|
-
for (const k of keys) {
|
|
169
|
-
drop.push(k)
|
|
170
|
-
const entry = entryOf(k)
|
|
171
|
-
const mine = [...s.advice, ...got].filter((y) => y.share === x.id)
|
|
172
|
-
const capped = mine.filter((y) => y.state === 'pending').length >= ADVICE_PENDING_MAX || mine.filter((y) => Date.parse(y.at) > now.getTime() - 3_600_000).length >= ADVICE_PER_HOUR
|
|
173
|
-
const wire = x.state === 'live' && a !== undefined && !capped ? adviceOfWire(await readEntry(bucket, k), a.email) : null
|
|
174
|
-
const w = wire === null ? null : adviceInStore(wire, ids)
|
|
175
|
-
// an entry's name matters for its files alone: they wait under it
|
|
176
|
-
if (w !== null && (w.files === undefined || entry !== null)) got.push({ id: newId(9), share: x.id, advisor: a!.id, state: 'pending', ...(entry !== null ? { entry } : {}), ...w })
|
|
177
|
-
else if (entry !== null) dropped.push(KEYS.upload('s', x.id, entry))
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
const proposed: Proposal[] = []
|
|
181
|
-
// a thread comes by a door whose rights still let its person start one
|
|
182
|
-
const byPropose = new Map(startPlacesOf(s, now).map((x) => [x.id, { ...x, propose: x.id }]))
|
|
183
|
-
for (const k of await bucket.list('inbox/p/')) {
|
|
184
|
-
drop.push(k)
|
|
185
|
-
const pid = /^inbox\/p\/([A-Za-z0-9_-]{22})\//.exec(k)?.[1]
|
|
186
|
-
const e = byPropose.get(pid ?? '')
|
|
187
|
-
const a = e === undefined ? undefined : s.advisors.find((y) => y.id === e.advisor)
|
|
188
|
-
const entry = entryOf(k)
|
|
189
|
-
const w = a !== undefined && entry !== null ? proposalOfWire(await readEntry(bucket, k), a.email) : null
|
|
190
|
-
// the door counts its inbox, which each pass empties: the caps that hold are counted here
|
|
191
|
-
const mine = [...s.proposals, ...proposed].filter((p) => p.propose === pid)
|
|
192
|
-
const capped = mine.filter((p) => p.state === 'pending').length >= PROPOSALS_PENDING_MAX || mine.filter((p) => Date.parse(p.at) > now.getTime() - 3_600_000).length >= PROPOSALS_PER_HOUR
|
|
193
|
-
if (w !== null && !capped) proposed.push({ id: newId(9), advisor: a!.id, repo: e!.repo, root: e!.root, propose: e!.propose!, entry: entry!, state: 'pending', ...w })
|
|
194
|
-
else if (pid !== undefined && entry !== null) dropped.push(KEYS.upload('p', pid, entry))
|
|
195
|
-
}
|
|
196
|
-
if (got.length > 0 || proposed.length > 0)
|
|
197
|
-
withState(dir, (st) => {
|
|
198
|
-
st.advice.push(...got)
|
|
199
|
-
st.proposals.push(...proposed)
|
|
200
|
-
})
|
|
201
|
-
for (const k of drop) await bucket.delete(k)
|
|
202
|
-
// the files of an entry read and refused, or of a share or project no longer open, leave with it
|
|
203
|
-
for (const prefix of dropped) for (const k of await bucket.list(prefix)) await bucket.delete(k)
|
|
204
|
-
await settle(dir, bucket, s, got, now)
|
|
205
|
-
// a pending one of an earlier pass the person's rights make direct now (a right given since, a pass that failed)
|
|
206
|
-
const fresh = new Set(got.map((g) => g.id))
|
|
207
|
-
const later = readState(dir)
|
|
208
|
-
for (const g of later.advice) if (g.state === 'pending' && !fresh.has(g.id)) await deliverDirect(dir, bucket, later, g, now)
|
|
209
|
-
for (const p of proposed) {
|
|
210
|
-
if (gateOf(rightsOf(s.rights, { person: p.advisor, project: p.repo }), 'newThread', (p.files ?? []).length > 0) !== 'direct') continue
|
|
211
|
-
try {
|
|
212
|
-
await openProposal(dir, p.id, 'direct', bucket, now)
|
|
213
|
-
} catch {
|
|
214
|
-
// left pending for his accept
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
await sweepUploads(dir, bucket, now)
|
|
218
|
-
return got
|
|
145
|
+
let n = 0
|
|
146
|
+
for (const g of s.advice) if (g.state === 'pending' && (await deliverDirect(dir, bucket, s, g, now))) n++
|
|
147
|
+
return n
|
|
219
148
|
}
|
|
220
149
|
|
|
221
150
|
/** a pending advice the person's rights make direct, into the thread now: true once it landed. A direct pick on a
|
|
@@ -254,15 +183,14 @@ async function settle(dir: string, bucket: Bucket, s: OwnerState, got: readonly
|
|
|
254
183
|
// a direct word is on his side of the thread already: it ends the aside by itself
|
|
255
184
|
if (!x.deferred || back.has(x.id) || delivered.has(g.id)) continue
|
|
256
185
|
back.add(x.id)
|
|
257
|
-
|
|
258
|
-
bringBack(x.root, x.address, `${name} answered: the advice waits for you`, now)
|
|
186
|
+
bringBack(x.root, x.address, now)
|
|
259
187
|
}
|
|
260
188
|
return delivered
|
|
261
189
|
}
|
|
262
190
|
|
|
263
|
-
/** one advice a user sent on the users' port, taken at the request: read with
|
|
264
|
-
* against the
|
|
265
|
-
*
|
|
191
|
+
/** one advice a user sent on the users' port, taken at the request: read with its strict schema (adviceOfWire),
|
|
192
|
+
* counted against the caps, kept pending in the owner's store, then settled. `entry` names where its files wait
|
|
193
|
+
* (KEYS.upload) */
|
|
266
194
|
export async function landAdvice(dir: string, bucket: Bucket, share: string, raw: unknown, entry: string, now = new Date()): Promise<{ waits: boolean } | { status: number; error: string }> {
|
|
267
195
|
const s = readState(dir)
|
|
268
196
|
const x = s.shares.find((y) => y.id === share)
|
|
@@ -280,6 +208,30 @@ export async function landAdvice(dir: string, bucket: Bucket, share: string, raw
|
|
|
280
208
|
return { waits: !delivered.has(g.id) }
|
|
281
209
|
}
|
|
282
210
|
|
|
211
|
+
/** a thread a user proposes on the users' port, taken at the request: read with its strict schema (proposalOfWire),
|
|
212
|
+
* counted against the caps, kept pending in the owner's store, opened at once when the person's rights make it direct.
|
|
213
|
+
* `place` is the start place's id (startPlacesOf), `entry` names where its files wait (KEYS.upload) */
|
|
214
|
+
export async function landProposal(dir: string, bucket: Bucket, place: string, raw: unknown, entry: string, now = new Date()): Promise<{ waits: boolean } | { status: number; error: string }> {
|
|
215
|
+
const s = readState(dir)
|
|
216
|
+
const e = startPlacesOf(s, now).find((x) => x.id === place)
|
|
217
|
+
const a = e === undefined ? undefined : s.advisors.find((y) => y.id === e.advisor)
|
|
218
|
+
if (e === undefined || a === undefined) return { status: 404, error: 'no such project' }
|
|
219
|
+
const mine = s.proposals.filter((p) => p.propose === place)
|
|
220
|
+
if (mine.filter((p) => p.state === 'pending').length >= PROPOSALS_PENDING_MAX || mine.filter((p) => Date.parse(p.at) > now.getTime() - 3_600_000).length >= PROPOSALS_PER_HOUR) return { status: 429, error: 'enough new threads for now: try again in an hour' }
|
|
221
|
+
const w = proposalOfWire(raw, a.email)
|
|
222
|
+
if (w === null) return { status: 400, error: 'this is not a thread to start' }
|
|
223
|
+
const p: Proposal = { id: newId(9), advisor: a.id, repo: e.repo, root: e.root, propose: place, entry, state: 'pending', ...w }
|
|
224
|
+
withState(dir, (st) => void st.proposals.push(p))
|
|
225
|
+
if (gateOf(rightsOf(s.rights, { person: p.advisor, project: p.repo }), 'newThread', (p.files ?? []).length > 0) !== 'direct') return { waits: true }
|
|
226
|
+
try {
|
|
227
|
+
await openProposal(dir, p.id, 'direct', bucket, now)
|
|
228
|
+
return { waits: false }
|
|
229
|
+
} catch {
|
|
230
|
+
// left pending for his accept
|
|
231
|
+
return { waits: true }
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
283
235
|
const adviceIn = (s: OwnerState, id: string): { a: Advice; x: Share; name: string } => {
|
|
284
236
|
const a = s.advice.find((y) => y.id === id)
|
|
285
237
|
if (a === undefined) throw new Error(`no advice ${id}`)
|
|
@@ -317,7 +269,7 @@ export function staleWhy(a: Advice, x: Share): string | null {
|
|
|
317
269
|
}
|
|
318
270
|
if (it.item.views.length !== a.version) return 'the version changed since the advisor read it'
|
|
319
271
|
// the person's own direct verdict never makes theirs stale: a new one is them changing their mind
|
|
320
|
-
if (!
|
|
272
|
+
if (!(it === t.head && threadState(t).headWaits) && theirVerdict(it, a.advisor) === null) return STALE_JUDGED
|
|
321
273
|
return null
|
|
322
274
|
}
|
|
323
275
|
|
|
@@ -440,8 +392,8 @@ export interface LocalFile {
|
|
|
440
392
|
name: string
|
|
441
393
|
}
|
|
442
394
|
|
|
443
|
-
/** the files of a submission out of the
|
|
444
|
-
* entry said; `done` removes the folder. Only
|
|
395
|
+
/** the files of a submission out of the port's folder into a folder of the Mac's own (0700), each checked against what
|
|
396
|
+
* its entry said; `done` removes the folder. Only the owner's accept calls it */
|
|
445
397
|
export async function fetchQuarantined(dir: string, bucket: Bucket, o: { scope: 's' | 'p'; id: string; entry: string; files: readonly PendingFile[] }): Promise<{ files: LocalFile[]; keys: string[]; done: () => void }> {
|
|
446
398
|
mkdirSync(dir, { recursive: true, mode: 0o700 })
|
|
447
399
|
const tmp = mkdtempSync(join(dir, 'accept-'))
|
|
@@ -515,7 +467,9 @@ async function openProposal(dir: string, id: string, how: 'owner' | 'direct', bu
|
|
|
515
467
|
try {
|
|
516
468
|
const store = storeDir(p.root)
|
|
517
469
|
const items = readAll(store).items
|
|
518
|
-
|
|
470
|
+
// a start with only files, from a page that named it « a new thread »: its first file names it
|
|
471
|
+
const title = startTitle(p.title === NO_TITLE ? '' : p.title, p.text ?? '', files)
|
|
472
|
+
const base = talkKey(title, now)
|
|
519
473
|
let key = base
|
|
520
474
|
for (let n = 2; threadOfAddress(`talk:${key}`, items) !== null; n++) key = `${base}-${n}`
|
|
521
475
|
// his accept raises it as his own; a direct open names the person, a word from outside as a player's report is
|
|
@@ -524,7 +478,7 @@ async function openProposal(dir: string, id: string, how: 'owner' | 'direct', bu
|
|
|
524
478
|
how === 'owner'
|
|
525
479
|
? { by: 'owner', from: 'advisors' }
|
|
526
480
|
: { by: 'player', player: name, server: 'advisors', serverId: Number.parseInt(createHash('sha256').update(p.id).digest('hex').slice(0, 12), 16), client: 'the advisors page', context: { advisor: p.advisor, proposal: p.id } }
|
|
527
|
-
const x = await raiseItem(store, { subject: { kind: 'object', address: `talk:${key}` }, origin, title
|
|
481
|
+
const x = await raiseItem(store, { subject: { kind: 'object', address: `talk:${key}` }, origin, title, what: `proposed by ${name}, an advisor`, now })
|
|
528
482
|
const words = p.text !== undefined ? `${name} proposes: ${p.text}` : `${name} proposes it`
|
|
529
483
|
if (how === 'owner') addMessage(store, x.item.id, 'owner', words, undefined, now, undefined, got !== null ? got.files : undefined)
|
|
530
484
|
else appendMessage(store, x.item.id, { who: 'player', text: words, advisor: { id: p.advisor, name } }, { now, ...(got !== null ? { files: got.files } : {}) })
|